// pages/user-my-bag/user-my-bag.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    localImg: app.globalData.staticimgUrl,  // 本地图片
    record:{},    
    commission:'',   // 收益
    getMoney: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.myuser();
    this.beautyCoinRule();    
  }, 

  //医生收益钱包
  myuser:function(){
    const that = this;
    app.request({
      url: 'doctor/wallet/getWalletByUser',
      data: {
        userId:wx.getStorageSync('userid')
      },
      success: function (res) {
        that.setData({
          commission: res.data.userAccount,//分成佣金
          getMoney: res.data.getMoney
        })
      }
    })
  },
  // 消费记录
  payRecord(){
    wx.navigateTo({
      url: '/pages/doctor-pay-record/doctor-pay-record'
    });
  },
  // 美丽币规则
  beautyCoinRule: function (e) {
    const that = this;
    app.request({
      url: 'system/officialapi/officialdetail', 
      data: {
        id: 5
      },
      success(res) {
        that.setData({
          record: res.data,
        })
      }
    })
  }

})